package riceSystem.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import riceSystem.dao.DaoTemplateInterface;
import riceSystem.entity.Seller;
import riceSystem.exception.RunException;
import riceSystem.service.ServiceTemplateInterface;
@Component("sellerService")
public class SellerServiceImpl implements ServiceTemplateInterface<Seller> {

	private DaoTemplateInterface<Seller> sellerDao;
	
	public DaoTemplateInterface<Seller> getSellerDao() {
		return sellerDao;
	}
	@Resource(name="sellerDao")
	public void setSellerDao(DaoTemplateInterface<Seller> sellerDao) {
		this.sellerDao = sellerDao;
	}

	public void add(Seller t) throws RunException {
		sellerDao.save(t);
	}

	public void removeById(long id) throws RunException {
		sellerDao.deleteById(id);
	}

	public void remove(Seller t) throws RunException {
		sellerDao.delete(t);
	}

	public long update(Seller t) throws RunException {
		return sellerDao.update(t);
	}

	public Seller getById(long id) throws RunException {
		return sellerDao.loadById(id);
	}

	public List<Seller> getAll() throws RunException {
		return sellerDao.loadAll();
	}

}
